% pseudo-likelihood
function [Lc, Ls] = pl(Lambda, X, P, p_q)

[M, N] = size(Lambda);
Lambda = Lambda(2:M-1, 2:N-1);
X = X(2:M-1, 2:N-1);

%L = prod(prod(P(Lambda + 1))) .* prod(prod(p_q(X .* 2 + 1 + bitand(Lambda, 1))));

[Lc1, Ls1] = myprod(P(Lambda + 1));
[Lc2, Ls2] = myprod(p_q(X .* 2 + 1 + bitand(Lambda, 1)));

[Lc, Ls] = sci_multi(Lc1, Ls1, Lc2, Ls2);